{% extends "base.jinja" %}

{% block title %}{{user_home}}的个人空间{% endblock %}
{% block keywords %}{{user_home}},{{site_options.keyword}}{% endblock %}
{% block description %}{{user_home}}的个人空间{% endblock %}

{% block css %},user.css{% endblock %}

{% block main %}
    {%- include 'user/head.jinja' -%}
    
    <div class="layout page uh-subscribe" id="page-sub">
        {% if sub_keywords %}
        <div class="u-crumb">
            <h3>我的订阅</h3>
            <a id="user-guide-add" class="uh-sub-add" href="{{domain}}subscribe/all/">订阅更多</a>
        </div>

        <div class="share" id="share">
            {% if share_data %}
                <ul>
                    <li class="st-edit" id="st-subkey">
                        <div class="st-item">
                            {% if current_tag == 'all' %}
                                <em class="s-tags-all">全部</em>
                            {% else %}
                                <a class="s-tags-all" href="{{domain}}u/subscribe/all/">全部</a>
                            {% endif %}
                            
                            {% for k in sub_keywords %}
                                {% if k.keyword == current_tag %}
                                    <em>{{k.keyword}}</em>
                                {% else %}
                                    <a href="{{domain}}u/subscribe/{{k.keyword}}/">{{k.keyword}}</a>
                                {% endif %}
                            {% endfor %}
                        </div>
                        <div class="st-edit">
                            <span class="st-edit-btn">编辑</span>
                            <a class="inp-btn-pk" href="javascript:;">确定</a>
                        </div>
                    </li>
                    {% for share in share_data %}
                        <li data-sid="{{share.share_id}}" data-mid="{{share.cover_id}}">
                            <a target="_blank" class="s-link" href="{{domain}}share/detail/all/{{share.share_id}}/#m{{share.cover_id}}" {% if loop.index0 >= 12 and share.background %}style="background:{{share.background}};opacity:0.5;"{% endif %}>
                            {% if loop.index0 < 12 %}
                                <img alt="{{share.title}}" src="{{share.cover}}!260" width="260"/>
                            {% else %}
                                <img alt="{{share.title}}" src="http://s.lovewith.me/static/images/blank.gif" data-src="{{share.cover}}!260" height="200" width="260"/>
                            {% endif %}
                            </a>
                            <div class="s-ext">
                                <p title="{{share.title|forceescape}}"><a target="_blank" href="{{domain}}share/detail/{{share.share_id}}/#m{{share.cover_id}}">{{share.title|safe|cut_str(32)}}</a></p>
                                <span class="s-ext-img">{{share.count}}P</span>
                            </div>
                            {% if share.is_video %}
                                <span class="ui ed-video" data-video="{{share.video}}"></span>
                            {% endif %}
                            {% if share.reserve %}
                            <a target="_blank" href="{{domain}}share/detail/all/{{share.share_id}}/#m{{share.cover_id}}" class="ui s-reserve"></a>
                            {% else %}
                                {% if share.sale_data %}
                                    <a target="_blank" href="{{action}}" class="ui s-sale"></a>
                                {% endif %}
                            {% endif %}
                        </li> 
                    {% endfor %}
                </ul>
                <div class="s-more"><a href="javascript:;" data-scroll="1" data-page="1" id="s-more-btn" data-action="/u/ajax/get/subscribe/?tag={{current_tag}}">更多..</a></div>
            {% else %}
            <div class="s-nodata">
                    <p>标签下还没有灵感</p>
                </div>
            {% endif %}
        </div>
        {% else %}
            <div class="s-nodata">
                <p>还没有订阅任何标签</p>
            </div>
        {% endif %}
    </div>

    <input type="hidden" id="ug-content" value="7@user-guide-sub@-312@-15|8@user-guide-like@-312@-15|9@user-guide-album@-312@-15|10@user-guide-add@-280@35" />
{% endblock %}

{% block script %}
<script>seajs.use('page/user/subscribe', function(p){p.render()});</script>
{% endblock %}